package zjt.random1;

import java.util.Random;

public class demo11 {
    public static void main(String[] args) {
        while (true){
            Random random = new Random();
            int i = random.nextInt(10);
            System.out.println(i);
            if(i==2){
                break;
            }
        }
    }
}
